<template>
    <div class="home">
        <el-tabs v-model="activeName">
            <el-tab-pane v-for="(item,i) in routes" :key="item.name" :label="item.name" :name="item.name">
                <component v-bind:is="currentTabComponent[i]" :activeName="activeName"></component>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>
  
<script>
// 图表组件./AboutView/AboutView.vue
import AboutView from '@/views/AboutView';
// 任意组件
import HelloWorld from '@/components/HelloWorld.vue';
import { routes } from '@/router';

export default {
    name: 'HomeView',
    components: { AboutView, HelloWorld },
    data() {
        return {
            routes,
            currentTabComponent: [HelloWorld, AboutView],
            activeName: 'home'
        }
    },
    watch:{
    },
    methods: {
    }
}
</script>